<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\ActiveForm;
$this->registerCssFile('/css/resetpwd.css');
$this->title = '找回密码-锐锋堂刀剑网';
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('/login/css/login.css');
$this->registerJsFile('/js/public.js');
$this->registerJsFile('/layer/layer.js');
$this->registerMetaTag([
    'name' => 'keywords',
    'content' => '找回密码-锐锋堂刀剑网'
]);
$this->registerMetaTag([
    'name' => 'description',
    'content' => '找回密码-锐锋堂刀剑网'
]);
if($flag==3){
    $this->registerJs("
        var time=setInterval (showTime, 1000);
var second=5;
function showTime()
{ 
if(second==0)
{
window.location='/site/login.html';
clearInterval(time);
}
$('#show_times').html(second);
second--;
}
        ");
}
?>
        <div class="forget_box ClearFix">
            <div class="forget_b_top"></div>
            <div class="forget_b_left"></div>
            <div class="forget_b_right"></div>
            <div class="forget_r_box">
                <h2>忘记密码</h2>
                <div class="flowsteps">
                    <ol class="num4">
                        <li class="first cur">
                            <div class="step_line"></div>
                            <span><i class="i">1</i><em>确认帐号</em></span></li>
                        <li class="<?=$flag?'cur':''?>">
                            <div class="step_line"></div>
                            <span><i class="i">2</i><em>验证身份</em></span></li>
                        <li class="<?=$flag>1?'cur':''?>">
                            <div class="step_line"></div>
                            <span><i class="i">3</i><em>设置密码</em></span></li>
                        <li class="last <?=$flag>2?'cur':''?>"><span><i class="i">4</i><em>完成</em></span></li>
                    </ol>
                </div>
                <div class="forget_item forget_item1" style="display: block;">
                    <?php $form=ActiveForm::begin(['options'=>['class'=>'form']])?>
                    <?php if($flag==1):?>
                    <?=$form->field($model, 'name')->hiddenInput()->label(false)?>
                    <div class="item item1">
                            <span class="label_reg">您的手机号：</span>
                            <span><?=substr_replace($model->tel,'****',3,4);?></span>
                        </div>
                        <div class="item item2">
    					<span class="label_reg">请填写验证码：</span> 
    					<?=$form->field($model, 'code',['options'=>['class'=>'code']])->textInput(['placeholder'=>'6位验证码','class'=>'itxt','maxlength'=>6])->label(false)?>
    					 <span class="getCode"
    						id="send_auth_code"> <input type='button' id="hide_times"
    						onclick='send(3,this)' value='获取验证码'>
    					</span>
    					<div class="err_box">
    						<span id="error_auth_code" class=""></span>
    					</div>
    				</div>
    				<?php elseif($flag==2):?>
    				<?=$form->field($model, 'name')->hiddenInput()->label(false)?>
    				<?=$form->field($model, 'code')->hiddenInput()->label(false)?>
    				<?=$form->field($model, 'password',['options'=>['class'=>'item item1'],'inputOptions'=>['class'=>'itxt onfocustxt','placeholder'=>'6-20个大小写英文字母、符号或数字']])->passwordInput(['max'=>20])->label('　新密码：')?>
                     <?=$form->field($model, 'rpassword',['options'=>['class'=>'item item1'],'inputOptions'=>['class'=>'itxt onfocustxt','placeholder'=>'请再次输入密码']])->passwordInput(['max'=>20])->label('确认密码：')?>
                     <?php elseif($flag==3):?>
                     <div class="forget_item forget_item4 ok">
                    <div class="itemcenter">
                        您的新密码已设置成功！&nbsp;&nbsp;请记住它哦！&nbsp;&nbsp;<a href="/site/login.html">点击此处</a><br>
                        立即返回首页&nbsp;&nbsp;<span id="show_times">5</span>秒后&nbsp;&nbsp;自动返回
                    </div>
                </div>  
                    <?php else:?>
                    	<?=$form->field($model, 'name',['options'=>['class'=>'item item1'],'inputOptions'=>['class'=>'itxt onfocustxt','placeholder'=>'已验证手机/用户名']])->textInput(['max'=>20])->label('用户名：')?>
                        <?php endif;?>
                        <div class="item item3">
                            <input type="submit" tabindex="3" class="btn_reg btn_step1" value="下一步">
                        </div>
                        <?php if(!flag):?>
                        <div class="forget_tips">如果您忘记了登录名，将无法找回您的帐户信息，您还可以<a href="/site/signup.html">重新注册</a></div>
                  	<?php endif;?>
                  <?php ActiveForm::end()?>
                </div>
            </div>
        </div>